package zz;

import java.io.*;

public class charset {
    public static void main(String[] args) throws IOException {
        /*FileReader fr = new FileReader("C:\\Users\\Administrator\\Desktop\\gbk.txt");
        int len = 0;
        while ((len = fr.read()) != -1) {
            System.out.println((char)len);

        }
        fr.close();*//**/
        zxx();
    }
    public static void zx() throws IOException {
        FileOutputStream fos = new FileOutputStream("C:\\Users\\Administrator\\Desktop\\gbk.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, "gbk");
        osw.write("你好");
        osw.close();

    }
    public static void zxx() throws IOException {
        FileInputStream fis = new FileInputStream("C:\\Users\\Administrator\\Desktop\\gbk.txt");
        InputStreamReader isr = new InputStreamReader(fis, "gbk");
        int len = 0;
        while ((len = isr.read()) != -1) {
            System.out.println((char)len);
        }
        isr.close();
    }
}
